package com.working.home.data.remote

import com.working.libbase.model.ArticleResponse
import com.working.libbase.model.BannerResponse
import com.working.libbase.model.HotSearchResponse
import com.working.libnet.model.PageBean
import com.working.libnet.model.WanResponse
import retrofit2.http.*

interface HomeServices {
    @GET("/article/list/{index}/json")
    suspend fun article(@Path(value = "index") index: Int): WanResponse<PageBean<ArticleResponse>>

    @GET("/banner/json")
    suspend fun banner(): WanResponse<List<BannerResponse>>

    @GET("/article/top/json")
    suspend fun topArticles(): WanResponse<List<ArticleResponse>>

    @GET("hotkey/json")
    suspend fun getHotSearchData(): WanResponse<MutableList<HotSearchResponse>>

    @POST("article/query/{page}/json")
    @FormUrlEncoded
    suspend fun search(
        @Path("page") page: Int,
        @Field("k") key: String
    ): WanResponse<PageBean<ArticleResponse>>
}